package com.github.wxiaoqi.security.biz.modules.community.api;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.common.cms.request.CmsTopicQueryParam;
import com.github.wxiaoqi.security.biz.modules.community.biz.CmsTopicBiz;
import com.github.wxiaoqi.security.biz.modules.community.entity.CmsTopic;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.EntityUtils;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * 话题-对外
 * @author Administrator
 *
 */
@Slf4j
@Controller
@RequestMapping("cmsTopics")
public class CmsTopicController extends BaseController<CmsTopicBiz,CmsTopic> {
	
	
	@ApiOperation("查询话题列表")
	@ResponseBody
	@RequestMapping(value="/list", method = RequestMethod.POST)
	public TableResultResponse<CmsTopic> queryCmsTopics(@RequestBody CmsTopicQueryParam param) throws Exception {
		log.info("查询话题 请求参数：{}",EntityUtils.beanToMap(param));
		return baseBiz.queryCmsTopics(param);
	}
	
	@ApiOperation("话题详情")
	@ResponseBody
	@RequestMapping(value="/info", method = RequestMethod.POST)
	public Map<String, Object> queryCmsTopicInfo(@RequestBody CmsTopicQueryParam param) throws Exception {
		log.info("话题详情 请求参数：{}",EntityUtils.beanToMap(param));
		return baseBiz.topicInfo(param);
	}
	
}